$(
    function () {
        clickchar1();
        function clickchar1() {
                this.myChar1 = echarts.init(document.getElementById('char1'));
                this.option1 = {
                    title: {
                        text: '每日的评论数量',
                        left: 'center',
                        textStyle: {
                            color: 'aliceblue'
                        }
                    },
                    tooltip: {
                        trigger: 'axis'
                    },
                    xAxis: {
                        data: [],
                        axisLabel: {
                            color: 'rgba(255, 255, 255, 1)'
                        },
                        name: '数量',
                        nameTextStyle: {
                            color: 'rgba(255, 255, 255, 1)'
                        }
                    },
                    yAxis: {
                        axisLabel: {
                            color: 'rgba(255, 255, 255, 1)'
                        }
                    },
                    series: [
                        {
                            name: '评论数量',
                            type: 'line',
                             smooth: true,
                            data: [],
                            itemStyle: {
      color: "rgb(114,250,97)"
    }
                        }
                    ]
                };
                axios.get('/char1').then(res => {
                    res.data.forEach(item => {
                        this.option1.xAxis.data.push(item.PubDate)
                        this.option1.series[0].data.push(item.count)
                    })
                    this.myChar1.setOption(this.option1)
                })


            }
    }

)
